#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int num(int a, int b)
{
    int i = 0;
    int count = 0;
    for (i = a; i <= b; i++)
    {
        int m = i;
        int ret = 0;
        while (m)
        {
            ret += m % 10;
            m /= 10;
        }
        if (ret % 5 == 0)
        {
            count++;
        }
    }
    return count;
}
int main()
{
    int a = 0;
    int b = 0;
    scanf("%d %d", &a, &b);
    int ret = num(a, b);
    printf("%d\n", ret);
    return 0;
}